/*******************************************************************************
 *                                    ZLG
 *                         ----------------------------
 *                         innovating embedded platform
 *
 * Copyright (c) 2001-present Guangzhou ZHIYUAN Electronics Co., Ltd.
 * All rights reserved.
 *
 * Contact information:
 * web site:    https://www.zlg.cn
 *******************************************************************************/
#ifndef __HPM6450_REGS_IOC_H
#define __HPM6450_REGS_IOC_H

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus*/

#include "core/include/hpm6e00_regs_base.h"
#include <stdint.h>

#define IOC_PAD_FUNC_CTL_LOOP_BACK_POS   (16U)
#define IOC_PAD_FUNC_CTL_LOOP_BACK_MASK  (0x1U << IOC_PAD_FUNC_CTL_LOOP_BACK_POS)
#define IOC_PAD_FUNC_CTL_ALT_SELECT_POS  (0U)
#define IOC_PAD_FUNC_CTL_ALT_SELECT_MASK (0x1FU << IOC_PAD_FUNC_CTL_ALT_SELECT_POS)

#define IOC_PAD_PAD_CTL_PS_POS           (18U)           /* 上拉下拉选择*/
#define IOC_PAD_PAD_CTL_PS_MASK          (0x1U << IOC_PAD_PAD_CTL_PS_POS)
#define IOC_PAD_PAD_CTL_PE_POS           (17U)            /* pull 使能*/
#define IOC_PAD_PAD_CTL_PE_MASK          (0x1U << IOC_PAD_PAD_CTL_PE_POS)
#define IOC_PAD_PAD_CTL_OD_POS           (8U)           /* 开漏选择 */
#define IOC_PAD_PAD_CTL_OD_MASK          (0x1U << IOC_PAD_PAD_CTL_OD_POS)
#define IOC_PAD_PAD_CTL_DS_POS           (0U)            /* 驱动能力 */
#define IOC_PAD_PAD_CTL_DS_MASK          (0x7U << IOC_PAD_PAD_CTL_DS_POS)

/* \brief IO 控制寄存器定义*/
typedef struct {
    struct {
        volatile uint32_t FUNC_CTL; /* 功能寄存器 */
        volatile uint32_t PAD_CTL;  /* pad 控制寄存器*/
    } pad[488];
} hpm_ioc_regs_t;

#define HPM_IOC   ((hpm_ioc_regs_t *)HPM_IOC_BASE)
#define HPM_PIOC  ((hpm_ioc_regs_t *)HPM_PIOC_BASE)
#define HPM_BIOC  ((hpm_ioc_regs_t *)HPM_BIOC_BASE)


#ifdef __cplusplus
}
#endif  /* __cplusplus  */
#endif




